﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using Model;
using System.Data.SqlClient;
using Common;
using Microsoft.CSharp.RuntimeBinder;
namespace BLL
{
    public class SysDictionaryBLL
    {
       
        /// <summary>
        /// 列表显示
        /// </summary>
        /// <returns></returns>
        public List<SysDictionary> GetList()
        {
            return new SysDictionaryDAL().GetList<SysDictionary>();
        }
        /// <summary>
        /// 获取最后一条所在类型的数据
        /// </summary>
        /// <returns></returns>
        public List<SysDictionary> GetLastList(SysDictionary dic)
        {
            return new SysDictionaryDAL().GetLastList(dic);
        }
        /// <summary>
        /// 字典列表增加
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public bool Add(params SqlParameter[] parameter)
        {
            SysDictionary dic = new SysDictionary();
            return new SysDictionaryDAL().Add(dic,parameter);
        }


        /// <summary>
        /// 绑定下拉框
        /// </summary>
        /// <returns></returns>
        public List<SysDictionary> DictionaryList(int type)
        {
            SqlParameter[]
                Parameter = new SqlParameter[]{
                    new SqlParameter("@Dictionary_Type",type)
                };
            return new SysDictionaryDAL().GetList<SysDictionary>(Parameter);
        }
    }
}
